<template>
    <el-container style="height:959px">
      <el-header style="background-color:darkseagreen;height:100px;padding: 0;">
      <img src="../../assts/jjj.png" style="height: 100px;width: 100%;">
      </el-header>
        <el-container>
          <el-aside width="200px" style="background-color:rgb(134, 129, 124)">
  
            <el-menu
              
              class="el-menu-vertical-demo"
              background-color="rgb(134, 129, 124)"
              text-color="#fff"
              router
              active-text-color="#ffd04b">
  
              <!-- 一级循环el-submenu,二级循环el-menu-item -->
              <el-submenu :index="m.id+''" v-for="m in menuList" :key="m.id+''">
  
                <template slot="title">
                  <i :class="m.icon"></i>
                  <span>{{ m.menuName }}</span>
                </template>
  
              <el-menu-item-group>
                <!-- <el-menu-item index="2">{{}}</el-menu-item> -->
                <el-menu-item :index="c.route" v-for="c in m.childrenMenu" :key="c.id+''">{{ c.menuName }}</el-menu-item>
                <!-- <el-menu-item index="4">选项4</el-menu-item> -->
              </el-menu-item-group>
  
            </el-submenu>
          </el-menu>
  
          </el-aside>
          <el-main style="background-color:white">
            <router-view></router-view>
  
          </el-main>
      </el-container>
  
      
  
    </el-container>
  </template>
  
  <script>
  export default {
      data(){
        return{
  
          pageNum:1,
          pageSize:5,
  
          dialogFormVisible:false,
          
          dialogform:{
              date:'',
              name:'',
              address:''
          },
      
            menuList:[],
            tableData: []
        }
      },
      methods:{
        updateDate(row){
            
            this.dialogFormVisible = true;
            this.dialogform = JSON.parse(JSON.stringify(row)) ;
  
        },
        prevPage(val){
            this.pageNum = val;
        },
        nextPage(val){
            this.pageNum = val;
        },
        changePage(val){
          this.pageNum = 1;
          this.pageSize = val;
        },
        queryBtn(){
          alert(this.pageNum+";"+this.pageSize)
        },
        queryFinanceMenu(){
          let jwt = localStorage.getItem('jwt');
          let userName = localStorage.getItem('userName');
          this.$axios.get('api/finance/menu/queryFinanceMenusByUserName?userName='+userName,{headers:{'jwt':jwt}})
          .then(res=>{
              console.log(res.data);
              if(res.data.code == 200){
                this.menuList = res.data.data
              }
          })
        }
      },
      created(){
        this.queryFinanceMenu();
      }
  }
  </script>
  
  <style scoped>
  
  </style>